<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
 <script>
   var myDate = new Date();
   console.log(myDate);

   //获取年份
   var year = myDate.getFullYear();

   //获取月份
   var month = myDate.getMonth()+1;

   //获取当月的第几天
   var day = myDate.getDate();

   //获取当前是多少小时
   var hours = myDate.getHours();

   //获取当前的分钟数
   var minutes = myDate.getMinutes();

   //获取当前的秒数
   var seconds = myDate.getSeconds();

   console.log(year+"年"+month+"月"+day+"日 "+hours+":"+minutes+":"+seconds);
 </script>
</html>
